<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>社交动态展示</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        /* 基础样式 */
        body {
            font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background-color: #f0f2f5;
            color: #1c1e21;
            line-height: 1.5;
        }
        
        .container {
            max-width: 900px;
        }
        
        .feed-section {
            margin-top: 2rem;
            margin-bottom: 3rem;
        }
        
        .section-title {
            font-weight: 700;
            margin-bottom: 1.5rem;
            padding-bottom: 0.75rem;
            border-bottom: 2px solid #1877f2;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        /* 动态卡片通用样式 */
        .post-card {
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
            margin-bottom: 1.5rem;
            overflow: hidden;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }
        
        .post-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }
        
        /* 用户信息区域 */
        .post-header {
            padding: 1rem 1.25rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        
        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            overflow: hidden;
            flex-shrink: 0;
        }
        
        .user-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .user-info {
            flex: 1;
        }
        
        .user-name {
            font-weight: 600;
            color: #1c1e21;
            text-decoration: none;
            transition: color 0.2s;
        }
        
        .user-name:hover {
            color: #1877f2;
        }
        
        .post-time {
            font-size: 0.875rem;
            color: #65676b;
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }
        
        .post-menu {
            color: #65676b;
            background: none;
            border: none;
            cursor: pointer;
            padding: 0.25rem;
            border-radius: 50%;
            transition: background-color 0.2s;
        }
        
        .post-menu:hover {
            background-color: #f0f2f5;
        }
        
        /* 内容区域 */
        .post-content {
            padding: 0 1.25rem 1rem;
        }
        
        .post-text {
            margin-bottom: 1rem;
            line-height: 1.6;
        }
        
        /* 图片容器样式 */
        .post-images {
            margin-bottom: 1rem;
            border-radius: 8px;
            overflow: hidden;
        }
        
        .single-image img {
            width: 100%;
            height: auto;
            display: block;
        }
        
        .multiple-images {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            grid-gap: 2px;
        }
        
        .multiple-images img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        
        .multiple-images.two-images img:first-child {
            grid-row: span 2;
        }
        
        .multiple-images.three-images img:first-child {
            grid-column: span 2;
            grid-row: span 2;
        }
        
        .multiple-images.four-images {
            grid-template-columns: repeat(2, 1fr);
            grid-template-rows: repeat(2, 1fr);
        }
        
        /* 互动区域 */
        .post-actions {
            padding: 0.5rem 1.25rem;
            border-top: 1px solid #e5e6eb;
            border-bottom: 1px solid #e5e6eb;
        }
        
        .action-buttons {
            display: flex;
            justify-content: space-around;
        }
        
        .action-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: none;
            border: none;
            color: #65676b;
            font-size: 0.9375rem;
            font-weight: 500;
            padding: 0.5rem 1rem;
            border-radius: 6px;
            cursor: pointer;
            transition: background-color 0.2s, color 0.2s;
        }
        
        .action-btn:hover {
            background-color: #f0f2f5;
        }
        
        .action-btn.liked {
            color: #1877f2;
        }
        
        .action-btn.commented {
            color: #1877f2;
        }
        
        /* 统计信息 */
        .post-stats {
            padding: 0.75rem 1.25rem;
            display: flex;
            justify-content: space-between;
            font-size: 0.875rem;
            color: #65676b;
        }
        
        .stats-likes {
            font-weight: 600;
        }
        
        /* 评论区域 */
        .post-comments {
            padding: 0 1.25rem 1rem;
        }
        
        .comment-item {
            padding: 0.75rem 0;
            border-bottom: 1px solid #f0f2f5;
        }
        
        .comment-item:last-child {
            border-bottom: none;
        }
        
        .comment-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 0.25rem;
        }
        
        .comment-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            overflow: hidden;
        }
        
        .comment-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .comment-author {
            font-weight: 600;
            font-size: 0.875rem;
        }
        
        .comment-time {
            font-size: 0.75rem;
            color: #65676b;
        }
        
        .comment-text {
            font-size: 0.875rem;
            margin-bottom: 0.25rem;
            padding-left: 38px; /* 头像宽度 + 间距 */
        }
        
        .comment-actions {
            display: flex;
            gap: 1rem;
            padding-left: 38px;
            font-size: 0.75rem;
        }
        
        .comment-action {
            color: #65676b;
            text-decoration: none;
            transition: color 0.2s;
        }
        
        .comment-action:hover {
            color: #1877f2;
        }
        
        /* 评论输入框 */
        .comment-input-container {
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            margin-top: 1rem;
        }
        
        .comment-input-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            overflow: hidden;
            flex-shrink: 0;
        }
        
        .comment-input-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .comment-input-wrapper {
            flex: 1;
            position: relative;
        }
        
        .comment-input {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 1px solid #ccd0d5;
            border-radius: 20px;
            font-size: 0.9375rem;
            resize: none;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        
        .comment-input:focus {
            outline: none;
            border-color: #a9b2c8;
            box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
        }
        
        .comment-submit {
            position: absolute;
            right: 0.5rem;
            bottom: 0.5rem;
            background-color: #1877f2;
            color: white;
            border: none;
            border-radius: 15px;
            padding: 0.25rem 0.75rem;
            font-size: 0.875rem;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.2s;
        }
        
        .comment-submit:hover {
            background-color: #166fe5;
        }
        
        /* 不同类型动态的特殊样式 */
        .post-type {
            display: inline-block;
            padding: 0.15rem 0.5rem;
            font-size: 0.75rem;
            border-radius: 4px;
            margin-right: 0.5rem;
            font-weight: 500;
        }
        
        .post-type.share {
            background-color: #e7f3ff;
            color: #1877f2;
        }
        
        .post-type.event {
            background-color: #e6fffa;
            color: #0d9488;
        }
        
        .post-type.article {
            background-color: #f3e8ff;
            color: #7e22ce;
        }
        
        /* 响应式调整 */
        @media (max-width: 576px) {
            .action-btn span {
                display: none;
            }
            
            .action-btn {
                justify-content: center;
                padding: 0.5rem;
            }
            
            .multiple-images {
                grid-gap: 1px;
            }
            
            .post-stats {
                flex-direction: column;
                gap: 0.25rem;
            }
        }
    </style>
</head>
<body>
    <div class="container py-4">
        <!-- 页面标题 -->
        <div class="text-center mb-5">
            <h1 class="display-5 mb-2">社区动态</h1>
            <p class="text-muted">发现身边的新鲜事，参与热门话题讨论</p>
        </div>
        
        <!-- 纯文字动态 -->
        <section class="feed-section">
            <h2 class="section-title">
                <i class="fas fa-comment-dots"></i> 最新动态
            </h2>
            
            <!-- 纯文字动态 -->
            <div class="post-card">
                <div class="post-header">
                    <div class="user-avatar">
                        <img src="https://picsum.photos/40/40?random=1" alt="用户头像">
                    </div>
                    <div class="user-info">
                        <a href="#" class="user-name">张小明</a>
                        <div class="post-time">
                            <span>2小时前</span>
                            <i class="fas fa-globe-americas"></i>
                        </div>
                    </div>
                    <button class="post-menu">
                        <i class="fas fa-ellipsis-h"></i>
                    </button>
                </div>
                
                <div class="post-content">
                    <div class="post-text">
                        今天终于完成了那个困扰我一周的项目难题！过程虽然艰难，但解决后的成就感真的难以言表。有时候觉得，编程的乐趣就在于不断克服挑战，突破自己的舒适区。感谢团队伙伴们的支持和建议，特别要感谢@李工 提供的关键思路！
                    </div>
                </div>
                
                <div class="post-actions">
                    <div class="action-buttons">
                        <button class="action-btn" id="like-btn-1">
                            <i class="far fa-thumbs-up"></i>
                            <span>点赞</span>
                        </button>
                        <button class="action-btn" id="comment-btn-1">
                            <i class="far fa-comment"></i>
                            <span>评论</span>
                        </button>
                        <button class="action-btn">
                            <i class="far fa-share-square"></i>
                            <span>分享</span>
                        </button>
                    </div>
                </div>
                
                <div class="post-stats">
                    <div class="stats-likes">18人点赞</div>
                    <div class="stats-comments">5条评论</div>
                </div>
                
                <div class="post-comments" id="comments-1">
                    <div class="comment-item">
                        <div class="comment-header">
                            <div class="comment-avatar">
                                <img src="https://picsum.photos/32/32?random=11" alt="评论用户头像">
                            </div>
                            <div class="comment-author">李工</div>
                            <div class="comment-time">1小时前</div>
                        </div>
                        <div class="comment-text">
                            恭喜！其实你的实现思路也给了我很多启发，互相学习~
                        </div>
                        <div class="comment-actions">
                            <a href="#" class="comment-action">点赞</a>
                            <a href="#" class="comment-action">回复</a>
                        </div>
                    </div>
                    
                    <div class="comment-input-container">
                        <div class="comment-input-avatar">
                            <img src="https://picsum.photos/36/36?random=99" alt="当前用户头像">
                        </div>
                        <div class="comment-input-wrapper">
                            <textarea class="comment-input" rows="1" placeholder="添加评论..."></textarea>
                            <button class="comment-submit">评论</button>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- 带单张图片的动态 -->
        <section class="feed-section">
            <h2 class="section-title">
                <i class="fas fa-image"></i> 图文动态
            </h2>
            
            <!-- 单张图片动态 -->
            <div class="post-card">
                <div class="post-header">
                    <div class="user-avatar">
                        <img src="https://picsum.photos/40/40?random=2" alt="用户头像">
                    </div>
                    <div class="user-info">
                        <a href="#" class="user-name">王摄影师</a>
                        <div class="post-time">
                            <span>昨天 15:30</span>
                            <i class="fas fa-globe-americas"></i>
                        </div>
                    </div>
                    <button class="post-menu">
                        <i class="fas fa-ellipsis-h"></i>
                    </button>
                </div>
                
                <div class="post-content">
                    <div class="post-text">
                        周末去郊外拍摄的日落，使用了长曝光技巧。大自然的色彩总是能给人带来惊喜，每次按下快门都是一次与光的对话。你们觉得这张照片的构图怎么样？欢迎提出宝贵意见！
                    </div>
                    
                    <div class="post-images">
                        <div class="single-image">
                            <img src="https://picsum.photos/800/500?random=20" alt="日落风景照">
                        </div>
                    </div>
                </div>
                
                <div class="post-actions">
                    <div class="action-buttons">
                        <button class="action-btn" id="like-btn-2">
                            <i class="far fa-thumbs-up"></i>
                            <span>点赞</span>
                        </button>
                        <button class="action-btn" id="comment-btn-2">
                            <i class="far fa-comment"></i>
                            <span>评论</span>
                        </button>
                        <button class="action-btn">
                            <i class="far fa-share-square"></i>
                            <span>分享</span>
                        </button>
                    </div>
                </div>
                
                <div class="post-stats">
                    <div class="stats-likes">87人点赞</div>
                    <div class="stats-comments">23条评论</div>
                </div>
                
                <div class="post-comments" id="comments-2">
                    <div class="comment-item">
                        <div class="comment-header">
                            <div class="comment-avatar">
                                <img src="https://picsum.photos/32/32?random=21" alt="评论用户头像">
                            </div>
                            <div class="comment-author">摄影爱好者</div>
                            <div class="comment-time">昨天 16:12</div>
                        </div>
                        <div class="comment-text">
                            色彩处理得非常棒！水面的长曝光效果让画面更有动感，地平线的位置也恰到好处，给人一种开阔的感觉。
                        </div>
                        <div class="comment-actions">
                            <a href="#" class="comment-action">点赞</a>
                            <a href="#" class="comment-action">回复</a>
                        </div>
                    </div>
                    
                    <div class="comment-input-container">
                        <div class="comment-input-avatar">
                            <img src="https://picsum.photos/36/36?random=99" alt="当前用户头像">
                        </div>
                        <div class="comment-input-wrapper">
                            <textarea class="comment-input" rows="1" placeholder="添加评论..."></textarea>
                            <button class="comment-submit">评论</button>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- 带多张图片的动态 -->
        <section class="feed-section">
            <h2 class="section-title">
                <i class="fas fa-images"></i> 多图动态
            </h2>
            
            <!-- 两张图片动态 -->
            <div class="post-card">
                <div class="post-header">
                    <div class="user-avatar">
                        <img src="https://picsum.photos/40/40?random=3" alt="用户头像">
                    </div>
                    <div class="user-info">
                        <a href="#" class="user-name">美食家小李</a>
                        <div class="post-time">
                            <span>3天前</span>
                            <i class="fas fa-globe-americas"></i>
                        </div>
                    </div>
                    <button class="post-menu">
                        <i class="fas fa-ellipsis-h"></i>
                    </button>
                </div>
                
                <div class="post-content">
                    <div class="post-text">
                        周末尝试做了两道新菜式：番茄牛腩和蒜蓉西兰花。牛腩炖了整整两个小时，入口即化，汤汁浓郁。西兰花则保持了脆嫩的口感，蒜香十足。自己做饭虽然麻烦，但健康又美味，值得！
                    </div>
                    
                    <div class="post-images">
                        <div class="multiple-images two-images">
                            <img src="https://picsum.photos/400/600?random=31" alt="番茄牛腩">
                            <img src="https://picsum.photos/400/300?random=32" alt="蒜蓉西兰花">
                        </div>
                    </div>
                </div>
                
                <div class="post-actions">
                    <div class="action-buttons">
                        <button class="action-btn" id="like-btn-3">
                            <i class="far fa-thumbs-up"></i>
                            <span>点赞</span>
                        </button>
                        <button class="action-btn" id="comment-btn-3">
                            <i class="far fa-comment"></i>
                            <span>评论</span>
                        </button>
                        <button class="action-btn">
                            <i class="far fa-share-square"></i>
                            <span>分享</span>
                        </button>
                    </div>
                </div>
                
                <div class="post-stats">
                    <div class="stats-likes">124人点赞</div>
                    <div class="stats-comments">37条评论</div>
                </div>
            </div>
            
            <!-- 四张图片动态 -->
            <div class="post-card">
                <div class="post-header">
                    <div class="user-avatar">
                        <img src="https://picsum.photos/40/40?random=4" alt="用户头像">
                    </div>
                    <div class="user-info">
                        <a href="#" class="user-name">旅行日记</a>
                        <div class="post-time">
                            <span>1周前</span>
                            <i class="fas fa-globe-americas"></i>
                        </div>
                    </div>
                    <button class="post-menu">
                        <i class="fas fa-ellipsis-h"></i>
                    </button>
                </div>
                
                <div class="post-content">
                    <div class="post-text">
                        上周去了古城旅行，分享几张照片。这里的建筑保存得非常完好，每一处都透露着历史的韵味。最喜欢清晨的古城，人少安静，阳光透过云层洒在石板路上，仿佛穿越回了过去。
                    </div>
                    
                    <div class="post-images">
                        <div class="multiple-images four-images">
                            <img src="https://picsum.photos/400/400?random=41" alt="古城街道">
                            <img src="https://picsum.photos/400/400?random=42" alt="古建筑细节">
                            <img src="https://picsum.photos/400/400?random=43" alt="古城清晨">
                            <img src="https://picsum.photos/400/400?random=44" alt="当地特色小吃">
                        </div>
                    </div>
                </div>
                
                <div class="post-actions">
                    <div class="action-buttons">
                        <button class="action-btn" id="like-btn-4">
                            <i class="far fa-thumbs-up"></i>
                            <span>点赞</span>
                        </button>
                        <button class="action-btn" id="comment-btn-4">
                            <i class="far fa-comment"></i>
                            <span>评论</span>
                        </button>
                        <button class="action-btn">
                            <i class="far fa-share-square"></i>
                            <span>分享</span>
                        </button>
                    </div>
                </div>
                
                <div class="post-stats">
                    <div class="stats-likes">215人点赞</div>
                    <div class="stats-comments">56条评论</div>
                </div>
            </div>
        </section>
        
        <!-- 分享类型的动态 -->
        <section class="feed-section">
            <h2 class="section-title">
                <i class="fas fa-share-alt"></i> 分享与活动
            </h2>
            
            <!-- 分享文章动态 -->
            <div class="post-card">
                <div class="post-header">
                    <div class="user-avatar">
                        <img src="https://picsum.photos/40/40?random=5" alt="用户头像">
                    </div>
                    <div class="user-info">
                        <a href="#" class="user-name">科技爱好者</a>
                        <div class="post-time">
                            <span>4天前</span>
                            <i class="fas fa-globe-americas"></i>
                        </div>
                    </div>
                    <button class="post-menu">
                        <i class="fas fa-ellipsis-h"></i>
                    </button>
                </div>
                
                <div class="post-content">
                    <div class="post-text">
                        <span class="post-type article">文章</span>
                        分享一篇关于人工智能发展趋势的深度分析，作者对未来五年AI技术的发展方向做了很有见地的预测。其中提到的AI伦理和监管问题特别值得我们思考，推荐给大家阅读。
                        <a href="#" class="user-name">《2023-2028人工智能发展白皮书》</a>
                    </div>
                </div>
                
                <div class="post-actions">
                    <div class="action-buttons">
                        <button class="action-btn" id="like-btn-5">
                            <i class="far fa-thumbs-up"></i>
                            <span>点赞</span>
                        </button>
                        <button class="action-btn" id="comment-btn-5">
                            <i class="far fa-comment"></i>
                            <span>评论</span>
                        </button>
                        <button class="action-btn">
                            <i class="far fa-share-square"></i>
                            <span>分享</span>
                        </button>
                    </div>
                </div>
                
                <div class="post-stats">
                    <div class="stats-likes">63人点赞</div>
                    <div class="stats-comments">14条评论</div>
                </div>
            </div>
            
            <!-- 活动动态 -->
            <div class="post-card">
                <div class="post-header">
                    <div class="user-avatar">
                        <img src="https://picsum.photos/40/40?random=6" alt="用户头像">
                    </div>
                    <div class="user-info">
                        <a href="#" class="user-name">城市读书会</a>
                        <div class="post-time">
                            <span>5天前</span>
                            <i class="fas fa-globe-americas"></i>
                        </div>
                    </div>
                    <button class="post-menu">
                        <i class="fas fa-ellipsis-h"></i>
                    </button>
                </div>
                
                <div class="post-content">
                    <div class="post-text">
                        <span class="post-type event">活动</span>
                        本周六下午2点，我们将举办第38期读书会，本期主题是"数字时代的阅读与思考"。我们会讨论在信息爆炸的今天，如何培养深度阅读能力，以及数字阅读与纸质阅读的优劣对比。欢迎各位书友参加！
                    </div>
                    
                    <div class="post-images">
                        <div class="single-image">
                            <img src="https://picsum.photos/800/400?random=61" alt="读书会活动海报">
                        </div>
                    </div>
                </div>
                
                <div class="post-actions">
                    <div class="action-buttons">
                        <button class="action-btn" id="like-btn-6">
                            <i class="far fa-thumbs-up"></i>
                            <span>点赞</span>
                        </button>
                        <button class="action-btn" id="comment-btn-6">
                            <i class="far fa-comment"></i>
                            <span>评论</span>
                        </button>
                        <button class="action-btn">
                            <i class="far fa-share-square"></i>
                            <span>分享</span>
                        </button>
                    </div>
                </div>
                
                <div class="post-stats">
                    <div class="stats-likes">42人点赞</div>
                    <div class="stats-comments">18条评论</div>
                </div>
            </div>
        </section>
    </div>

    <!-- Bootstrap 5 JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 点赞功能
            const likeButtons = document.querySelectorAll('[id^="like-btn-"]');
            likeButtons.forEach(button => {
                button.addEventListener('click', function() {
                    this.classList.toggle('liked');
                    const icon = this.querySelector('i');
                    
                    if (this.classList.contains('liked')) {
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        
                        // 更新点赞数
                        const postCard = this.closest('.post-card');
                        const statsLikes = postCard.querySelector('.stats-likes');
                        if (statsLikes) {
                            let count = parseInt(statsLikes.textContent);
                            statsLikes.textContent = `${count + 1}人点赞`;
                        }
                    } else {
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        
                        // 更新点赞数
                        const postCard = this.closest('.post-card');
                        const statsLikes = postCard.querySelector('.stats-likes');
                        if (statsLikes) {
                            let count = parseInt(statsLikes.textContent);
                            statsLikes.textContent = `${count - 1}人点赞`;
                        }
                    }
                });
            });
            
            // 评论框自动调整高度
            const commentInputs = document.querySelectorAll('.comment-input');
            commentInputs.forEach(input => {
                input.addEventListener('input', function() {
                    this.style.height = 'auto';
                    this.style.height = (this.scrollHeight > 100 ? 100 : this.scrollHeight) + 'px';
                });
            });
            
            // 评论按钮点击效果
            const commentButtons = document.querySelectorAll('[id^="comment-btn-"]');
            commentButtons.forEach(button => {
                button.addEventListener('click', function() {
                    const postId = this.id.split('-')[2];
                    const commentsSection = document.getElementById(`comments-${postId}`);
                    
                    if (commentsSection) {
                        // 滚动到评论区
                        commentsSection.scrollIntoView({ behavior: 'smooth', block: 'end' });
                        
                        // 聚焦到评论框
                        const commentInput = commentsSection.querySelector('.comment-input');
                        if (commentInput) {
                            commentInput.focus();
                        }
                        
                        // 添加评论按钮高亮效果
                        this.classList.add('commented');
                        setTimeout(() => {
                            this.classList.remove('commented');
                        }, 500);
                    }
                });
            });
            
            // 评论提交功能
            const commentSubmits = document.querySelectorAll('.comment-submit');
            commentSubmits.forEach(button => {
                button.addEventListener('click', function() {
                    const inputWrapper = this.closest('.comment-input-wrapper');
                    const commentInput = inputWrapper.querySelector('.comment-input');
                    const commentText = commentInput.value.trim();
                    
                    if (commentText) {
                        const commentsSection = this.closest('.post-comments');
                        const commentList = commentsSection.querySelector('.comment-item') 
                            ? commentsSection 
                            : commentsSection;
                        
                        // 创建新评论元素
                        const newComment = document.createElement('div');
                        newComment.className = 'comment-item';
                        newComment.innerHTML = `
                            <div class="comment-header">
                                <div class="comment-avatar">
                                    <img src="https://picsum.photos/32/32?random=99" alt="当前用户头像">
                                </div>
                                <div class="comment-author">我</div>
                                <div class="comment-time">刚刚</div>
                            </div>
                            <div class="comment-text">
                                ${commentText}
                            </div>
                            <div class="comment-actions">
                                <a href="#" class="comment-action">点赞</a>
                                <a href="#" class="comment-action">回复</a>
                            </div>
                        `;
                        
                        // 插入新评论到评论区顶部
                        const commentInputContainer = commentsSection.querySelector('.comment-input-container');
                        commentsSection.insertBefore(newComment, commentInputContainer);
                        
                        // 清空评论框
                        commentInput.value = '';
                        commentInput.style.height = 'auto';
                        
                        // 更新评论数
                        const postCard = this.closest('.post-card');
                        const statsComments = postCard.querySelector('.stats-comments');
                        if (statsComments) {
                            let count = parseInt(statsComments.textContent);
                            statsComments.textContent = `${count + 1}条评论`;
                        }
                    }
                });
            });
            
            // 图片点击放大效果
            const postImages = document.querySelectorAll('.post-images img');
            postImages.forEach(image => {
                image.addEventListener('click', function() {
                    // 创建全屏查看的模态框
                    const modal = document.createElement('div');
                    modal.style.position = 'fixed';
                    modal.style.top = '0';
                    modal.style.left = '0';
                    modal.style.width = '100%';
                    modal.style.height = '100%';
                    modal.style.backgroundColor = 'rgba(0, 0, 0, 0.9)';
                    modal.style.display = 'flex';
                    modal.style.alignItems = 'center';
                    modal.style.justifyContent = 'center';
                    modal.style.zIndex = '1000';
                    modal.style.cursor = 'zoom-out';
                    
                    const imgClone = this.cloneNode(true);
                    imgClone.style.maxWidth = '90%';
                    imgClone.style.maxHeight = '90%';
                    imgClone.style.objectFit = 'contain';
                    
                    modal.appendChild(imgClone);
                    document.body.appendChild(modal);
                    
                    // 点击模态框关闭
                    modal.addEventListener('click', function() {
                        document.body.removeChild(modal);
                    });
                });
            });
        });
    </script>
</body>
</html>
    
